import 'package:flutter/material.dart';
import 'package:getwidget/getwidget.dart';

class HomePro extends StatefulWidget {



  @override
  _HomeProState createState() => _HomeProState();
}

class _HomeProState extends State<HomePro> {
  late TabController tabController;
  bool isChecked = false;



  @override
  void initState() {
    super.initState();
    //tabController = TabController(length: 3, vsync: null);
  }

  @override
  void dispose() {
    tabController.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        //appBar: AppBar(title: Text("首页")), SwiperPro
        body: ListView(
      children: [
        Padding(padding: EdgeInsets.only(top: 20)),
        // Container(
        //   height: 200,
        //   child: SwiperPro(),
        // ),
        Container(
          color: Colors.green,
          alignment: Alignment.center,
          child: Text("首页111"),
        ),
        GFButton(
          onPressed: () {},
          text: "primary",
          icon: Icon(Icons.facebook),
          color: Colors.yellow,
          hoverColor: Colors.blue,
          shape: GFButtonShape.pills,
        ),
        GFImageOverlay(
            height: 200,
            width: 300,
            borderRadius: BorderRadius.circular(50),
            image: AssetImage('lib/assets/bg_login.jpg')),
        GFImageOverlay(
          height: 200,
          width: 200,
          shape: BoxShape.circle,
          image: AssetImage('lib/assets/bg_login.jpg'),
          boxFit: BoxFit.cover,
        ),
        GFCard(
          boxFit: BoxFit.cover,
          image: Image.asset('lib/assets/bg_login.jpg'),
          title: GFListTile(
            avatar: GFAvatar(
              backgroundImage: AssetImage('lib/assets/bg_login.jpg'),
            ),
            title: Text('Card Title'),
            subTitle: Text('Card Sub Title'),
          ),
          content: Text("Some quick example text to build on the card"),
          buttonBar: GFButtonBar(
            children: <Widget>[
              GFButton(
                onPressed: () {},
                text: 'Buy',
              ),
              GFButton(
                onPressed: () {},
                text: 'Cancel',
              ),
            ],
          ),
        ),
        GFCard(
          boxFit: BoxFit.cover,
          titlePosition: GFPosition.start,
          showOverlayImage: true,
          imageOverlay: AssetImage(
            'lib/assets/bg_login.jpg',
          ),
          title: GFListTile(
            avatar: GFAvatar(),
            titleText: 'Game Controllers',
            subTitleText: 'PlayStation 4',
          ),
          content: Text("Some quick example text to build on the card"),
          buttonBar: GFButtonBar(
            children: <Widget>[
              GFAvatar(
                backgroundColor: GFColors.PRIMARY,
                child: Icon(
                  Icons.share,
                  color: Colors.white,
                ),
              ),
              GFToggle(
                onChanged: (val) {},
                value: true,
              ),
              GFToggle(
                onChanged: (val) {},
                value: true,
                type: GFToggleType.ios,
              ),
              GFToggle(
                onChanged: (val) {},
                value: true,
                type: GFToggleType.square,
              ),
              GFToggle(
                onChanged: (e){
                  print(e);
                },
                value: true,
                type: GFToggleType.custom,
              ),
              GFCheckbox(
                size: GFSize.SMALL,
                activeBgColor: GFColors.DANGER,
                onChanged: (value) {
                  setState(() {
                    isChecked = value;
                  });
                },
                value: isChecked,
              ),
              GFCard(
                content: Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: <Widget>[
                    GFCheckbox(
                      size: GFSize.SMALL,
                      activeBgColor: GFColors.DANGER,
                      type: GFCheckboxType.circle,
                      onChanged: (value) {
                        setState(() {
                          isChecked = value;
                        });
                      },
                      value: isChecked,
                      inactiveIcon: null,
                    ),
                    GFCheckbox(
                      type: GFCheckboxType.circle,
                      activeBgColor: GFColors.SECONDARY,
                      onChanged: (value) {
                        setState(() {
                          isChecked = value;
                        });
                      },
                      value: isChecked,
                    ),
                    GFCheckbox(
                      activeBgColor: GFColors.SUCCESS,
                      size: GFSize.LARGE,
                      type: GFCheckboxType.circle,
                      onChanged: (value) {
                        setState(() {
                          isChecked = value;
                        });
                      },
                      value: isChecked,
                      inactiveIcon: null,
                    ),
                  ],
                ),
              ),
              GFCard(
                content: Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: <Widget>[
                    GFCheckbox(
                      size: GFSize.SMALL,
                      type: GFCheckboxType.custom,
                      onChanged: (value) {
                        setState(() {
                          isChecked = value;
                        });
                      },
                      value: isChecked,
                      inactiveIcon: null,
                    ),
                    GFCheckbox(
                      type: GFCheckboxType.square,
                      activeBgColor: GFColors.SECONDARY,
                      activeIcon: Icon(Icons.sentiment_satisfied),
                      onChanged: (value) {
                        setState(() {
                          isChecked = value;
                        });
                      },
                      value: isChecked,
                      inactiveIcon: Icon(Icons.sentiment_dissatisfied),
                    ),
                    GFCheckbox(
                      size: GFSize.MEDIUM,
                      type: GFCheckboxType.custom,
                      onChanged: (value) {
                        setState(() {
                          isChecked = value;
                        });
                      },
                      value: isChecked,
                      customBgColor: GFColors.INFO,
                    ),

                  ],
                ),
              ),
              GFCheckboxListTile(
                titleText: 'Arthur Shelby',
                subTitleText: 'By order of the peaky blinders',
                avatar: GFAvatar(
                  backgroundImage: AssetImage('lib/assets/bg_login.jpg'),
                ),
                size: 25,
                activeBgColor: Colors.green,
                type: GFCheckboxType.circle,
                activeIcon: Icon(
                  Icons.check,
                  size: 15,
                  color: Colors.white,
                ),
                onChanged: (value) {
                  setState(() {
                    isChecked = value;
                  });
                },
                value: isChecked,
                inactiveIcon: null,
              ),

            ],
          ),
        ),
      ],
    ));
  }
}
